#!/bin/bash
rm -rf *.o
rm -rf *.gch
rm -rf mserver
rm -rf convey

gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c xml_lib.c xml_lib.h  -I/usr/include/libxml2/
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c mysql_lib.c mysql_lib.h  -I/usr/local/mysql/include/mysql -DUNIV_LINUX
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c sdb_struct.h sdb_struct.c  
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c BuildXml.c BuildXml.h xml_lib.h  -I/usr/include/libxml2/
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c link.c link.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c socketbase.c socketbase.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c conf_lib.c conf_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c record_lib.c record_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c convey_lib.c convey_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c memcache_lib.c memcache_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c client_lib.c client_lib.h
gcc -g -Wall -pedantic -Wshadow -Wunused -Wstrict-aliasing -c time_lib.c time_lib.h


gcc -g -o mserver mserver.c socketbase.o link.o conf_lib.o record_lib.o time_lib.o client_lib.o memcache_lib.o convey_lib.o BuildXml.o mysql_lib.o sdb_struct.o xml_lib.o   -lxml2  -rdynamic -L/usr/local/mysql/lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm 

gcc -g -o convey convey.c conf_lib.o sdb_struct.o time_lib.o client_lib.o convey_lib.o mysql_lib.o -rdynamic -L/usr/local/mysql/lib/mysql -lmysqlclient_r -lpthread -lz -lcrypt -lnsl -lm

